home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
atlib.asm
< prev
next >
Wrap
Assembly Source File
|
2000-09-26
|
16KB
|
1,048 lines
; *******************************************************************
; ** **
; ** ATUtilities Library **
; ** Copright (C) 1992-1993 by Thomas Dreibholz **
; ** All rights reserved **
; ** **
; ** Hauptprogramm **
; ** **
; *******************************************************************
include "exec/types.i"
include "exec/initializers.i"
include "exec/libraries.i"
include "exec/lists.i"
include "exec/nodes.i"
include "exec/resident.i"
include "libraries/dos.i"
include "exec/alerts.i"
CALLSYS MACRO
jsr _LVO%1(a6)
endm
XLIB MACRO
xref _LVO%1
endm
STRUCTURE ViewLib,LIB_SIZE
ULONG ml_SysLib
ULONG ml_DosLib
ULONG ml_GfxLib
ULONG ml_IntLib
ULONG ml_JanusLib
ULONG ml_IconLib
ULONG ml_WBLib
ULONG ml_FontLib
ULONG ml_OpalFont
ULONG ml_SegList
UBYTE ml_Flags
UBYTE ml_Pad
LABEL ViewLib_SIZEOF
XLIB OpenLibrary
XLIB CloseLibrary
XLIB FreeMem
XLIB Remove
XLIB Alert
XLIB OpenDiskFont
XLIB CloseFont
public _GetOpalFont
public _ExitWarning
public _ErrorRequest
public _InfoRequest
public _MultiRequest
public _CallUtility
public _CreateUtilityList
public _DeleteUtilityList
public _CallUtilityList
public _CreatePublicHandler
public _DeletePublicHandler
public _AllocCommMemory
public _FreeCommMemory
public _DrawPBorder
public _DrawNBorder
public _DrawPTextBorder
public _DrawNTextBorder
public _WriteText
public _WriteMText
public _SelectStdFPen
public _SelectStdBPen
public _UsePrefs
public _CreateWindow
public _DeleteStdWindow
public _CreateBoolToggleGadget
public _CreateStrIntGadget
public _CreateProcess
public _AvailJanusMem
public _Utility
public _UtilityQuiet
public _Received
public _InformationBox
public _LibraryInfo
public _CreatePrivateHandler
public _DeletePrivateHandler
public _ConvertDateStamp
public _CreateAppItem
public _DeleteAppItem
public _ChangeTaskPri
public _Help
public _CreatePublicService
public _DeletePublicService
public _DrawMPTextBorder
public _DrawMNTextBorder
public _CreatePropGadget
public _BuildMenuStrip
public _AddMenu
public _AddItem
public _AddSubItem
public _UseMenuStrip
public _RemoveMenuStrip
public _GetOpalLine
public _GetOpalLine450
public _MacFormat
public _DisplayPicture
public _ShowPicture
public _MouseButton
public _CreateScreen
public _BorderHeight
Version equ 38
Revision equ 1
Pri equ 0
Start:
moveq.l #0,d0
rts
Resident:
dc.w RTC_MATCHWORD
dc.l Resident
dc.l EndCode
dc.b RTF_AUTOINIT
dc.b Version
dc.b NT_LIBRARY
dc.b Pri
dc.l LibName
dc.l idString
dc.l Init
LibName: dc.b 'at-utilities.library',0
idString: dc.b 'AT-Utilities 38.1 (27 Nov 93)',13,10,0
DosName: dc.b 'dos.library',0
IntName: dc.b 'intuition.library',0
GfxName: dc.b 'graphics.library',0
JanusName: dc.b 'janus.library',0
IconName: dc.b 'icon.library',0
WBName: dc.b 'workbench.library',0
FontName: dc.b 'diskfont.library',0
OpalName: dc.b 'opal.font',0
OpalDef:
dc.l OpalName
dc.w 9
dc.b 0
dc.b 2
even
EndCode:
Init:
dc.l ViewLib_SIZEOF
dc.l FuncTable
dc.l DataTable
dc.l InitRoutine
FuncTable:
dc.l Open
dc.l Close
dc.l Expunge
dc.l Null
dc.l GetOpalFont
dc.l ExitWarning
dc.l ErrorRequest
dc.l InfoRequest
dc.l MultiRequest
dc.l CallUtility
dc.l CreateUtilityList
dc.l DeleteUtilityList
dc.l CallUtilityList
dc.l CreatePublicHandler
dc.l DeletePublicHandler
dc.l AllocCommMemory
dc.l FreeCommMemory
dc.l DrawPBorder
dc.l DrawNBorder
dc.l DrawPTextBorder
dc.l DrawNTextBorder
dc.l WriteText
dc.l SelectStdFPen
dc.l SelectStdBPen
dc.l UsePrefs
dc.l CreateStdWindow
dc.l DeleteStdWindow
dc.l CreateBoolGadget
dc.l CreateStringGadget
dc.l CreateNToggleGadget
dc.l CreateSToggleGadget
dc.l CreateIntegerGadget
dc.l DrawCPBorder
dc.l DrawCNBorder
dc.l DrawCPTextBorder
dc.l DrawCNTextBorder
dc.l CreateProcess
dc.l AvailJanusMem
dc.l Utility
dc.l Received
dc.l InformationBox
dc.l LibraryInfo
dc.l CreatePrivateHandler
dc.l DeletePrivateHandler
dc.l ConvertDateStamp
dc.l ConvertIntelMotorola
dc.l CreateAppItem
dc.l DeleteAppItem
dc.l ChangeTaskPri
dc.l Help
dc.l CreateMinGadget
dc.l CreatePublicService
dc.l DeletePublicService
dc.l UtilityQuiet
dc.l DrawMPTextBorder
dc.l DrawMNTextBorder
dc.l CreatePropGadget
dc.l CreateMBoolGadget
dc.l BuildMenuStrip
dc.l AddMenu
dc.l AddItem
dc.l AddSubItem
dc.l UseMenuStrip
dc.l RemoveMenuStrip
dc.l _GetOpalLine
dc.l _GetOpalLine450
dc.l MacFormat
dc.l DisplayPicture
dc.l ShowPicture
dc.l _MouseButton
dc.l ScreenInformationBox
dc.l CreateWindow
dc.l CreateScreen
dc.l WriteMText
dc.l ExtInformationBox
dc.l BorderHeight
dc.l -1
DataTable:
INITBYTE LH_TYPE,NT_LIBRARY
INITLONG LN_NAME,LibName
INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
INITWORD LIB_VERSION,Version
INITWORD LIB_REVISION,Revision
INITLONG LIB_IDSTRING,idString
dc.l 0
InitRoutine:
move.l a5,-(a7)
move.l d0,a5
move.l a6,ml_SysLib(a5)
move.l a6,_SysBase
move.l a0,ml_SegList(a5)
lea DosName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_DosLib(a5)
move.l d0,_DOSBase
bne.s Dos_Okay
clr.l d0
bra Init_Ende
Dos_Okay:
lea GfxName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_GfxLib(a5)
move.l d0,_GfxBase
bne.s Gfx_Okay
clr.l d0
bra Init_Ende
Gfx_Okay:
lea IntName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_IntLib(a5)
move.l d0,_IntuitionBase
bne.s Int_Okay
clr.l d0
bra Init_Ende
Int_Okay:
lea JanusName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_JanusLib(a5)
move.l d0,_JanusBase
lea WBName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_WBLib(a5)
move.l d0,_WorkbenchBase
lea IconName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_IconLib(a5)
move.l d0,_IconBase
lea FontName(pc),a1
move.l #0,d0
CALLSYS OpenLibrary
move.l d0,ml_FontLib(a5)
move.l d0,_DiskfontBase
tst.l d0
bne DiskFont_Okay
movem.l d1-d7/a0-a6,-(sp)
move.l #1,d0
jsr ErrorRequest(pc)
movem.l (sp)+,d1-d7/a0-a6
clr.l d0
bra Init_Ende
DiskFont_Okay:
movem.l d1-d7/a0-a6,-(sp)
lea OpalDef(pc),a0
move.l ml_FontLib(a5),a6
CALLSYS OpenDiskFont
movem.l (sp)+,d1-d7/a0-a6
move.l d0,ml_OpalFont(a5)
move.l d0,_OpalFont
tst.l d0
bne OpalFont_Okay
movem.l d1-d7/a0-a6,-(sp)
move.l #2,d0
jsr ErrorRequest(pc)
movem.l (sp)+,d1-d7/a0-a6
clr.l d0
bra Init_Ende
OpalFont_Okay:
move.l a5,d0
Init_Ende:
move.l (a7)+,a5
rts
Open:
addq.w #1,LIB_OPENCNT(a6)
bclr #LIBB_DELEXP,ml_Flags(a6)
move.l a6,d0
rts
Close:
clr.l d0
subq.w #1,LIB_OPENCNT(a6)
bne.s 1$
btst #LIBB_DELEXP,ml_Flags(a5)
beq.s 1$
bsr Expunge
1$:
rts
Expunge:
movem.l d2/a5-a6,-(a7)
move.l a6,a5
move.l ml_SysLib(a5),a6
tst.w LIB_OPENCNT(a5)
beq.s 1$
bset #LIBB_DELEXP,ml_Flags(a5)
clr.l d0
bra.s Expunge_end
1$:
move.l ml_SegList(a5),d2
move.l a5,a1
CALLSYS Remove
move.l ml_DosLib(a5),a1
CALLSYS CloseLibrary
move.l ml_IntLib(a5),a1
CALLSYS CloseLibrary
move.l a6,-(sp)
move.l ml_GfxLib(a5),a6
move.l ml_OpalFont(a5),a1
CALLSYS CloseFont
move.l (sp)+,a6
move.l ml_GfxLib(a5),a1
CALLSYS CloseLibrary
move.l ml_FontLib(a5),a1
CALLSYS CloseLibrary
clr.l d0
move.l a5,a1
move.w LIB_NEGSIZE(a5),d0
sub.l d0,a1
add.w LIB_POSSIZE(a5),d0
CALLSYS FreeMem
move.l d2,d0
Expunge_end:
movem.l (a7)+,d2/a5-a6
rts
Null:
moveq #0,d0
rts
GetOpalFont:
jsr _GetOpalFont(pc)
rts
ExitWarning:
jsr _ExitWarning(pc)
rts
ErrorRequest:
move.l d0,-(sp)
jsr _ErrorRequest(pc)
addq.w #4,sp
rts
InfoRequest:
move.l a0,-(sp)
jsr _InfoRequest(pc)
addq.w #4,sp
rts
MultiRequest:
move.l a3,-(sp)
move.l a2,-(sp)
move.l a1,-(sp)
move.l a0,-(sp)
jsr _MultiRequest(pc)
add.w #16,sp
rts
CallUtility:
move.l a0,-(sp)
jsr _CallUtility(pc)
addq.w #4,sp
rts
CreateUtilityList:
jsr _CreateUtilityList(pc)
rts
DeleteUtilityList:
jsr _DeleteUtilityList(pc)
rts
CallUtilityList:
move.l d0,-(sp)
jsr _CallUtilityList(pc)
addq.w #4,sp
rts
CreatePublicHandler:
move.l d0,-(sp)
jsr _CreatePublicHandler(pc)
addq.w #4,sp
rts
DeletePublicHandler:
move.l a0,-(sp)
jsr _DeletePublicHandler(pc)
addq.w #4,sp
rts
AllocCommMemory:
jsr _AllocCommMemory(pc)
rts
FreeCommMemory:
jsr _FreeCommMemory(pc)
rts
DrawPBorder:
move.l #0,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawPBorder(pc)
add.w #24,sp
rts
DrawNBorder:
move.l #0,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawNBorder(pc)
add.w #24,sp
rts
DrawPTextBorder:
move.l #0,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawPTextBorder(pc)
add.w #28,sp
rts
DrawNTextBorder:
move.l #0,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawNTextBorder(pc)
add.w #28,sp
rts
WriteText:
move.l a1,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _WriteText(pc)
add.w #16,sp
rts
SelectStdFPen:
move.l a0,-(sp)
jsr _SelectStdFPen(pc)
add.w #4,sp
rts
SelectStdBPen:
move.l a0,-(sp)
jsr _SelectStdBPen(pc)
add.w #4,sp
rts
UsePrefs:
jsr _UsePrefs(pc)
rts
CreateStdWindow:
move.l d5,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #0,-(sp)
jsr _CreateWindow(pc)
add.w #32,sp
rts
DeleteStdWindow:
move.l a0,-(sp)
jsr _DeleteStdWindow(pc)
add.w #4,sp
rts
CreateBoolGadget:
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #0,-(sp)
jsr _CreateBoolToggleGadget(pc)
add.w #32,sp
rts
CreateMinGadget:
move.l d4,-(sp)
move.l #0,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #4,-(sp)
jsr _CreateBoolToggleGadget(pc)
add.w #32,sp
rts
CreateStringGadget:
move.l d5,-(sp)
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #0,-(sp)
jsr _CreateStrIntGadget(pc)
add.w #36,sp
rts
CreateNToggleGadget:
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #1,-(sp)
jsr _CreateBoolToggleGadget(pc)
add.w #32,sp
rts
CreateSToggleGadget:
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #2,-(sp)
jsr _CreateBoolToggleGadget(pc)
add.w #32,sp
rts
CreateIntegerGadget:
move.l d5,-(sp)
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #1,-(sp)
jsr _CreateStrIntGadget(pc)
add.w #36,sp
rts
DrawCPBorder:
move.l #1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawPBorder(pc)
add.w #24,sp
rts
DrawCNBorder:
move.l #1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawNBorder(pc)
add.w #24,sp
rts
DrawCPTextBorder:
move.l #1,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawPTextBorder(pc)
add.w #28,sp
rts
DrawCNTextBorder:
move.l #1,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawNTextBorder(pc)
add.w #28,sp
rts
CreateProcess:
move.l d1,-(sp)
move.l a1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _CreateProcess(pc)
add.w #16,sp
rts
AvailJanusMem:
move.l d0,-(sp)
jsr _AvailJanusMem(pc)
addq.w #4,sp
rts
Utility:
move.l d0,-(sp)
move.l a0,-(sp)
jsr _Utility(pc)
addq.w #8,sp
rts
UtilityQuiet:
move.l d0,-(sp)
move.l a0,-(sp)
jsr _UtilityQuiet(pc)
addq.w #8,sp
rts
Received:
move.l a0,-(sp)
jsr _Received(pc)
addq.w #4,sp
rts
ExtInformationBox:
move.l a2,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l a1,-(sp)
jsr _InformationBox(pc)
add.w #32,sp
rts
ScreenInformationBox:
move.l #0,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l a1,-(sp)
jsr _InformationBox(pc)
add.w #32,sp
rts
InformationBox:
move.l #0,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #0,-(sp)
jsr _InformationBox(pc)
add.w #32,sp
rts
LibraryInfo:
jsr _LibraryInfo(pc)
rts
CreatePrivateHandler:
move.l d1,-(sp)
move.l d0,-(sp)
jsr _CreatePrivateHandler(pc)
addq.w #8,sp
rts
DeletePrivateHandler:
move.l a0,-(sp)
jsr _DeletePrivateHandler(pc)
addq.w #4,sp
rts
ConvertDateStamp:
move.l a1,-(sp)
move.l a0,-(sp)
jsr _ConvertDateStamp(pc)
addq.w #8,sp
rts
ConvertIntelMotorola:
swap d0
rts
CreateAppItem:
move.l a0,-(sp)
jsr _CreateAppItem(pc)
addq.w #4,sp
rts
DeleteAppItem:
move.l a0,-(sp)
jsr _DeleteAppItem(pc)
addq.w #4,sp
rts
ChangeTaskPri:
move.l d0,-(sp)
jsr _ChangeTaskPri(pc)
addq.w #4,sp
rts
Help:
move.l d0,-(sp)
move.l a0,-(sp)
jsr _Help(pc)
addq.w #8,sp
rts
CreatePublicService:
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
jsr _CreatePublicService(pc)
add.w #12,sp
rts
DeletePublicService:
move.l a0,-(sp)
jsr _DeletePublicService(pc)
addq.w #4,sp
rts
DrawMPTextBorder:
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawMPTextBorder(pc)
add.w #24,sp
rts
DrawMNTextBorder:
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DrawMNTextBorder(pc)
add.w #24,sp
rts
CreatePropGadget:
move.l a1,-(sp)
move.l d7,-(sp)
move.l d6,-(sp)
move.l d5,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _CreatePropGadget(pc)
add.w #40,sp
rts
CreateMBoolGadget:
move.l d4,-(sp)
move.l a1,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l #5,-(sp)
jsr _CreateBoolToggleGadget(pc)
add.w #32,sp
rts
BuildMenuStrip:
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _BuildMenuStrip(pc)
add.w #12,sp
rts
AddMenu:
move.l d1,-(sp)
move.l d0,-(sp)
move.l a1,-(sp)
move.l a0,-(sp)
jsr _AddMenu(pc)
add.w #16,sp
rts
AddItem:
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a1,-(sp)
move.l a0,-(sp)
jsr _AddItem(pc)
add.w #24,sp
rts
AddSubItem:
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a1,-(sp)
move.l a0,-(sp)
jsr _AddSubItem(pc)
add.w #24,sp
rts
UseMenuStrip:
move.l a0,-(sp)
jsr _UseMenuStrip(pc)
addq.w #4,sp
rts
RemoveMenuStrip:
move.l d0,-(sp)
move.l a0,-(sp)
jsr _RemoveMenuStrip(pc)
addq.w #8,sp
rts
MacFormat:
move.l d0,-(sp)
move.l a1,-(sp)
move.l a0,-(sp)
jsr _MacFormat(pc)
add.w #12,sp
rts
DisplayPicture:
move.l d0,-(sp)
move.l a0,-(sp)
jsr _DisplayPicture(pc)
addq.w #8,sp
rts
ShowPicture:
move.l a0,-(sp)
jsr _ShowPicture(pc)
addq.w #4,sp
rts
CreateWindow:
move.l d5,-(sp)
move.l d4,-(sp)
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
move.l a1,-(sp)
jsr _CreateWindow(pc)
add.w #32,sp
rts
CreateScreen:
move.l d3,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _CreateScreen(pc)
add.w #20,sp
rts
WriteMText:
move.l a1,-(sp)
move.l d2,-(sp)
move.l d1,-(sp)
move.l d0,-(sp)
move.l a0,-(sp)
jsr _WriteMText(pc)
add.w #20,sp
rts
BorderHeight:
jsr _BorderHeight(pc)
rts
dseg
even
public _DOSBase
public _IntuitionBase
public _GfxBase
public _JanusBase
public _SysBase
public _IconBase
public _DiskfontBase
public _OpalFont
global _DOSBase,4
global _IntuitionBase,4
global _GfxBase,4
global _JanusBase,4
global _SysBase,4
global _IconBase,4
global _WorkbenchBase,4
global _DiskfontBase,4
global _OpalFont,4
END